//
//  AnimationRes.h
//  CandyJump
//
//  Created by Bon Lam on 05/03/2011.
//  Copyright 2011 Peru Republic. All rights reserved.
//

#import <Foundation/Foundation.h>

//=====================================================================================================================
@class CCAnimation;
@interface AnimationRes : NSObject <NSXMLParserDelegate> {

	NSMutableDictionary *animationDictionary;
	
	//	Used for reading XML
	NSMutableDictionary *currentLoadingAnimationDictionary;
	CCAnimation *currentLoadingAnimation;
}

//---------------------------------------------------------------------------------------------------------------------
@property(nonatomic, readonly, retain)NSMutableDictionary* animationDictionary;

#pragma mark -
#pragma mark Singleton Object Functions
- (id)init;
- (void)dealloc;
+ (id)allocWithZone:(NSZone *)zone;
- (id)copyWithZone:(NSZone *)zone;
- (id)retain;
- (NSUInteger)retainCount;
- (void)release;
- (id)autorelease;

#pragma mark Custom Functions
+ (AnimationRes *)sharedRes;
- (void)clearCachedAnimation;
- (NSMutableDictionary*)loadAnimation:(NSString*)filename;		//	NSDictionary of CCAnimation 

#pragma mark NSXMLParserDelegate
- (BOOL)parseXMLFile:(NSString *)filename;
- (void)parseXMLData:(NSData *)data parseError:(NSError **)error;
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict;
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName;
- (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError;
- (void)parserDidEndDocument:(NSXMLParser *)parser;

@end
